﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Lhxm.Sgs.WebApp.Models
{
    public class MyExceptionAttribute:HandleErrorAttribute
    {
        public static Queue<Exception> exceptionQue = new Queue<Exception>();
        //可以捕获异常
        public override void OnException(ExceptionContext filterContext)
        {
            base.OnException(filterContext);
            Exception ex = filterContext.Exception;
            //写入队列
            exceptionQue.Enqueue(ex);
            //跳转错误页
            filterContext.HttpContext.Response.Redirect("/Error.html");

        }
    }
}